<?php

namespace app\services\office;

use app\dao\office\OfficeDatumDao;
use app\exceptions\AdminException;
use app\services\BaseService;

class OfficeDatumService extends BaseService
{

    public function __construct(OfficeDatumDao $dao)
    {
        $this->dao = $dao;
    }

    public function index(array $where)
    {
        return $this ->dao -> index($where);
    }

    public function createOrUpdate(array $where)
    {
        if ($where['id']) return  $this ->dao -> updateDao($where);
        return $this ->dao ->create($where);
    }

    public function delete(array $where)
    {
        return $this ->dao ->deleteDao($where);
    }



    //----------------------------------------api-------------------------------------------------------------------
    /*
     * 获取课程资料
     */
    public function getDatum(array $where){
        return $this->dao->getDatum($where);

    }
}